package zenkml.core {
	import flash.display.Shape;
	import flash.display.Sprite;
	import flash.filters.DropShadowFilter;
	import flash.geom.Point;
	
	/**
	 * ...
	 * @author Zszen
	 */
	public class Draw extends Sprite {
		private var data:Array
		private var potGroup:Array = [];
		private var line:Line
		public function Draw() {
			line = new Line
			addChild(line)
		}
		public function clearData():void {
			line.clear()
			var pot:Pot
			while (potGroup.length > 0) {
				pot = potGroup.shift() as Pot
				if (pot != null) {
					removeChild(pot)
				}
			}
		}
		public function updateData(points:Array):void {
			clearData()
			data = points
			var pot:Pot
			for (var i:int = 0; i < data.length; i++) {
				var point:Point = data[i] as Point;
				point.x *= 10000
				point.y *= -10000
				line.lineTo(point,i/data.length,i!=0)
				//pot = new Pot(point)
				//addChild(pot)
				//potGroup.push(pot)
			}
		}
	}
}